#Author:jtt
#Content:XunLianYing
import os

import yaml

#
# def data_file():
#     with open('../data/search_data.yaml','r',encoding='utf-8') as f:
#         case_data = yaml.safe_load(f)
#         data_list = list()
#         for i in case_data['test_search'].values():
#             data_list.append(i)
#         return data_list
#
# print(data_file())

def data_file(filename,key):
    with open('..%sdata%s%s'%(os.sep,os.sep,filename),'r',encoding='utf-8') as f:
        case_data = yaml.safe_load(f)[key]
        data_list = list()
        for i in case_data.values():
            data_list.append(i)
        return data_list

